package persistence;

import model.entity.Item;

import common.Result;
import common.ValueResult;

/**
 * @author Trevor Dixon
 * 
 *         An object that provides access to a data store.
 * 
 * @param <Entity>
 *          The data transfer object type used to shuttle data to and from this data access object.
 */
public interface ItemsDAO
{
  /**
   * @return A Result indicating whether the operation was successful, attached to which is set of
   *         all entity data transfer objects in the data store.
   */
  public ValueResult<java.util.Set<Item>> getAll();

  public ValueResult<Integer> getCurrentItemBarcodeID();

  /**
   * Adds an entity to the data store.
   * 
   * @param dto
   * @return A Result indicating whether the operation was completed successfully.
   */
  public Result add(Item item);

  /**
   * Updates an entity in the data store.
   * 
   * @param dto
   * @return A Result indicating whether the operation was completed successfully.
   */
  public Result update(Item item);

  /**
   * Removes an entity from the data store.
   * 
   * @param dto
   * @return A Result indicating whether the operation was completed successfully.
   */
  public Result delete(Item item);

  public Result save(java.util.Set<Item> items);

  public Result saveCurrentItemBarcodeID(int id);
}
